/*
 * @(#)cn.design.pattern.facade 2020/4/18/0018
 *
 * Copy Right@ 人人译视界
 */


package cn.design.pattern.facade;

import cn.design.pattern.build.improve.House;
import org.omg.CORBA.PUBLIC_MEMBER;

import java.awt.image.RasterOp;

/**
 * <pre>
 * @author tuwei
 *
 * @version 0.9
 *
 * 修改版本: 0.9
 * 修改日期: 2020/4/18/0018
 * 修改人 :  tuwei
 * 修改说明: 初步完成
 * 复审人 ：
 * </pre>
 */
public class HomeTheaterFacade {
	// 定义子系统对象
	private TheaterLight theaterLight;
	private Popcon popcon;
	private Stereo stereo;
	private Projector projector;
	private Screen screen;
	private DVDPlayer dvdPlayer;

	public HomeTheaterFacade() {
		theaterLight = TheaterLight.getInstance();
		popcon = Popcon.getInstance();
		stereo = Stereo.getInstance();
		projector = Projector.getInstance();
		screen = Screen.getInstance();
		dvdPlayer = DVDPlayer.getInstance();
	}

	public void ready() {
		popcon.on();
		popcon.pop();
		screen.down();
		projector.on();
		stereo.up();
		dvdPlayer.on();
		theaterLight.dim();
	}

	public void play() {
		dvdPlayer.play();
	}

	public void end() {
		popcon.off();
		theaterLight.bright();
		screen.up();
		projector.off();
		stereo.off();
		dvdPlayer.off();
	}
}
